package com.dy.nygl.controller;

import java.text.SimpleDateFormat;
import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.dy.nygl.pojo.FromTo;
import com.dy.nygl.service.FromToService;

@Controller
@RequestMapping("/fromto")
public class FromToController {

	@Resource(name="fromToService")
	private FromToService fromToService;
	
	@RequestMapping("/update.action")
	public void update(){
		SimpleDateFormat dateFormater = new SimpleDateFormat("yyyy-MM-dd HH:mm:SS");
		Date date=new Date();
		FromTo fromTo=new FromTo();
		fromTo.setId(1);
		fromTo.setFromgo("2016-1-1");
		fromTo.setTogo("2016-12-29");
		fromTo.setCreatetime(dateFormater.format(date));
		fromToService.update(fromTo);
	}
	
	
}
